package com.dao;

import com.pojo.OrderSetting;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface OrderSettingDao {
    /*<!--根据预约日期查询是否存在-->*/
    int findByOrderDate(Date date);
    //新增设置预约
    int add(OrderSetting orderSetting);
    //修改预约
    int updateNumberByOrderDate(@Param("date") Date date,@Param("nn") int nn);
    //查询用户传递的月份,对应的相关数据
    @Select("select * from t_ordersetting where orderDate like #{date}")
    List<OrderSetting> findByYearAndMonth(String date);

    //修改预约设置订单+1
    @Update("update t_ordersetting set reservations=#{reservations} where orderDate=#{date}")
    void updateReservations(@Param("date") Date date, @Param("reservations") int i);
}
